import 'package:cbec_app/utils/Tools.dart';
import 'package:flutter/material.dart';

class SmallMode extends StatelessWidget {
  final String text;
  final String desc;
  final String unit;
  final Color? textColor;
  final Color? descColor;

  SmallMode({
    super.key,
    required this.text,
    required this.desc,
    required this.unit,
    Color? textColor,
    Color? descColor,
  })  : textColor = textColor ?? Tools.fromHex('#FFFFFF'),
        descColor = descColor ?? Tools.fromHex('#FFFFFF');

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              text,
              style: TextStyle(color: textColor, fontSize: 20, fontWeight: FontWeight.bold),
            ),
            Text(
              unit,
              style: TextStyle(color: textColor, fontSize: 10, fontWeight: FontWeight.normal),
            ),
          ],
        ),
        Text(
          desc,
          style: TextStyle(color: descColor, fontWeight: FontWeight.normal, fontSize: 10),
        ),
      ],
    );
  }
}
